package com.local.service.impl;

import com.base.dao.DAO;
import com.base.util.PageData;
import com.local.service.ReportManager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lee on 2016/6/24.
 */
@Service("reportService")
public class ReportServiceImpl implements ReportManager {

    @Resource(name = "daoSupport")
    private DAO daoSupport;

    public List<PageData> getReportInfo(PageData pd) {
        List<PageData> info = new ArrayList<PageData>();
        try {
            info = (List<PageData>) daoSupport.findForList("ReportMapper.getReportInfo",pd);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return info;
    }

    public void insertReport(PageData pd) {
        try {
            daoSupport.save("ReportMapper.insertReport",pd);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public List<PageData> getExamine(PageData pd) {

        List<PageData> examineList = new ArrayList<PageData>();
        try {
            examineList = (List<PageData>) daoSupport.findForList("ReportMapper.getExamine",pd);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return examineList;
    }

    public void updateExamine(PageData pd) {

        try {
            daoSupport.update("ReportMapper.updReportInfoByExamine",pd);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
